//
//  R_First_TableViewCell.swift
//  MyFood
//
//  Created by dllo on 16/2/16.
//  Copyright © 2016年 XRG. All rights reserved.
//

import UIKit 

protocol R_First_TableViewCellDelegate{

    func clickFourButton(btnId:Int)
    func clickImgTap(num: Int)

}
class R_First_TableViewCell: UITableViewCell {

    @IBOutlet weak var new: UIButton!

    @IBOutlet weak var newLabel: UILabel!

    @IBOutlet weak var shicai: UIButton!

    @IBOutlet weak var shicaiLabel: UILabel!

    @IBOutlet weak var changjing: UIButton!

    @IBOutlet weak var changjingLabel: UILabel!
    @IBOutlet weak var love: UIButton!

    @IBOutlet weak var loveLabel: UILabel!

    var delegate : R_First_TableViewCellDelegate!
    
    @IBAction func NewOneAction(sender: AnyObject) {
        self.delegate.clickFourButton(0)
    }

    @IBAction func daPeiAction(sender: AnyObject) {

        self.delegate.clickFourButton(2)
    }

    @IBAction func changJingAction(sender: AnyObject) {
        self.delegate.clickFourButton(4)

    }

    @IBAction func loveAction(sender: AnyObject) {
        self.delegate.clickFourButton(6)
    }

    @IBOutlet weak var leftImg: UIImageView!

    @IBOutlet weak var rightImg: UIImageView!


    override func awakeFromNib() {
        super.awakeFromNib()

        let leftTap = UITapGestureRecognizer(target: self, action: "leftTap")
        leftImg.addGestureRecognizer(leftTap)

        let rightTap = UITapGestureRecognizer(target: self, action: "rightTap")
        rightImg.addGestureRecognizer(rightTap)

        // Initialization code
    }

    func leftTap(){
        self.delegate.clickImgTap(0)

    }

    func rightTap(){
        self.delegate.clickImgTap(1)

    }

    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

    
}
